from selenium.webdriver.common.by import By

from base import BaseAction


class IndexPageHome(BaseAction):
    #     定义元素
    look_ele = By.CSS_SELECTOR, '.ibtn'  # 详情
    menu_index_ele = By.XPATH, '//*[text()="首页"]'
    menu_yx = By.XPATH, '//*[@id="YS-yxzj"]'  # 隐形正畸
    menu_gd = By.XPATH, '//*[@id="YS-gdzj"]'  # 固定正畸
    menu_xf = By.XPATH, '//*[@id="YS-xf"][1]'  # 修复
    menu_zz = By.XPATH, '//*[@id="YS-xf"][2]'  # 种植
    menu_gt = By.XPATH, '//*[@id="YS-gt"]'  # 沟通
    index_search1_ele = By.XPATH, '//*[@placeholder="患者姓名/编号"]//input'
    index_search2_ele = By.XPATH, '//*[text()="查询"]'
    details_ele = By.XPATH, '//*[text()="详情"]'
    model1_ele = By.XPATH, '//ul[1]/li[1]//*[text()="查看"]'
    model2_ele = By.XPATH, '//ul[1]/li[2]//*[text()="查看"]'
    model3_ele = By.XPATH, '//ul[1]/li[3]//*[text()="查看"]'
    model4_ele = By.XPATH, '//ul[1]/li[4]//*[text()="查看"]'
    # quit1_ele = By.XPATH, '//*[@id="app"]/div[1]/div/div[3]/span/img'  # 公测进入退出按钮
    quit1_ele = By.XPATH, '//div[2]//img'  # 内测进入退出按钮
    quit2_ele = By.XPATH, '//*[text()="退出登录"]'
    quit3_ele = By.XPATH, '//*[@id="yg_msgbox_dom"]//input[1][@class="okbtn"]'  # 确认退出
    center1_ele = By.XPATH, '//*[text()="个人中心"]'
    center2_ele = By.XPATH, '//*[text()="管理"][1]'  # 进入加工厂
    use_success_ele = By.XPATH, '//*[text()="详情"]'

    def get_look_ele(self):
        return self.get_element(self.look_ele)

    def get_menu_index_ele(self):
        return self.get_element(self.menu_index_ele)

    def get_menu_yx_ele(self):
        return self.get_element(self.menu_yx)

    def get_menu_gd_ele(self):
        return self.get_element(self.menu_gd)

    def get_menu_xf_ele(self):
        return self.get_element(self.menu_xf)

    def get_menu_zz_ele(self):
        return self.get_element(self.menu_zz)

    def get_menu_gt_ele(self):
        return self.get_element(self.menu_gt)

    def get_quit1_ele(self):
        return self.get_element(self.quit1_ele)

    def get_quit2_ele(self):
        return self.get_element(self.quit2_ele)

    def get_quit3_ele(self):
        return self.get_element(self.quit3_ele)

    def get_center1_ele(self):
        return self.get_element(self.center1_ele)

    def get_center2_ele(self):
        return self.get_element(self.center2_ele)

    def get_use_sucess_ele(self):
        return self.get_element(self.use_success_ele)

    def get_index_search1_ele(self):
        return self.get_element(self.index_search1_ele)

    def get_index_search2_ele(self):
        return self.get_element(self.index_search2_ele)

    def get_details_ele(self):
        return self.get_element(self.details_ele)

    # 一直查看患者下不同的模型
    def get_model1_ele(self):
        return self.get_element(self.model1_ele)

    def get_model2_ele(self):
        return self.get_element(self.model2_ele)

    def get_model3_ele(self):
        return self.get_element(self.model3_ele)

    def get_model4_ele(self):
        return self.get_element(self.model4_ele)
